home *** CD-ROM | disk | FTP | other *** search
-
- #ifndef _TYPES_H_
- #define _TYPES_H_
-
-
- //
- //VECTOR3D Ütruktura
- //
- struct VECTOR3D
- {
- float X,Y,Z; //suradnice
-
-
- };
-
- //
- //VECTOR2D Ütruktura
- //
- struct VECTOR2D
- {
- float X,Y;
- };
-
- //
- //COLOR Ütruktura
- //
- struct COLOR
- {
- float R,G,B,A;
- };
-
-
- //
- //PLANE Ütruktura
- //
- struct PLANE
- {
- VECTOR3D Normal;
- float D;
- };
-
- //-----------------------------
- //DIRECTX
- //----------------------------
- D3DXMATRIXA16 GetMatrix(VECTOR3D Pos,VECTOR3D Rot,VECTOR3D Sca);
-
- VECTOR3D TransformPoint(VECTOR3D Point,D3DXMATRIXA16 Matica);
- PLANE TransformPlane(PLANE Plane,D3DXMATRIXA16 Matica);
- VECTOR3D TransformNormal(VECTOR3D Normal,D3DXMATRIXA16 Matica);
-
- VECTOR3D UnTransformPoint(VECTOR3D Point,D3DXMATRIXA16 Matica);
-
- VECTOR3D Project(VECTOR3D B);
- VECTOR3D UnProject(VECTOR3D B);
-
- D3DMATERIAL9 GetMaterial(COLOR Ambient,
- COLOR Diffuse,
- COLOR Specular,
- COLOR Emissive,float Power);
-
- inline DWORD FtoDW( FLOAT f ) { return *((DWORD*)&f); }
-
- //-----------------------------
- //FPS
- //----------------------------
- extern float FPS ; //presne FPS
- extern int iFPS ; //priblizne FPS
- extern __int64 counter1;
- extern __int64 counter2;
- extern __int64 freq;
-
- void TimeStart();
- void TimeEnd();
- float Power(float Value);
- float PowerTime(float Value);
-
- //----------------------------
- //COLOR
- //----------------------------
- COLOR GetColor(float R,float G,float B);
- COLOR GetColor(float A,float R,float G,float B);
-
- //----------------------------
- //VECTOR3D
- //----------------------------
-
- VECTOR3D Get3D(float X,float Y,float Z);
- VECTOR2D Get2D(float X,float Y);
-
- VECTOR3D RandomVector();
-
- void Sub(VECTOR3D *V,VECTOR3D A,VECTOR3D B);
- void Add(VECTOR3D *V,VECTOR3D A,VECTOR3D B);
- void Mul(VECTOR3D *V,VECTOR3D A,VECTOR3D B);
- void Cross(VECTOR3D *V,VECTOR3D A,VECTOR3D B);
- float Absolute(VECTOR3D V);
- void Normalize(VECTOR3D *V);
- float Dot(VECTOR3D A,VECTOR3D B);
-
-
-
-
- //----------------------------
- //PLANE
- //----------------------------
-
- PLANE GetPlane(VECTOR3D Normal,float D);
-
- PLANE CreatePlaneFace(VECTOR3D B1,VECTOR3D B2,VECTOR3D B3);
- PLANE CreatePlanePoint(VECTOR3D B1,VECTOR3D B2);
- float PointPlane(PLANE P,VECTOR3D B);
-
- bool CalcPriesEdge(VECTOR3D *B,PLANE P,VECTOR3D B1,VECTOR3D B2);
- bool CalcPriesPlane(VECTOR3D *B,PLANE P1,PLANE P2,PLANE P3);
-
- //----------------------------
- //COLLISION
- //----------------------------
- bool CollisionBoxEdge(VECTOR3D P1,VECTOR3D P2,VECTOR3D Min,VECTOR3D Max);
-
-
- //------------------------------
- //OSTATNE
- //------------------------------
- float CalcAngleCentre(VECTOR3D S,VECTOR3D P1, VECTOR3D P2);
- float CalcAngleVector(VECTOR3D P1, VECTOR3D P2);
-
- float CalcDistance(VECTOR3D B1,VECTOR3D B2);
-
- float RandomMinMax(float fMin,float fMax);
-
- VECTOR3D GetRotationLok(VECTOR3D Pos, VECTOR3D Lok);
- VECTOR3D GetRotationSme(VECTOR3D Sme);
-
- VECTOR2D EnvironmentMapping(VECTOR3D Point,
- VECTOR3D Normal,
- float Offset,
- D3DXMATRIXA16 ViewMatrix);
-
- VECTOR2D BumpMapping(VECTOR3D Normal,VECTOR2D TexCoor,float Offset,
- D3DXMATRIXA16 ViewMatrix);
-
- float FTRX(float Value);
- float FTRY(float Value);
-
- #endif //_TYPES_H_